<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
    <meta charset="utf-8" />
    <title>{$Think.lang.Qibei}</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />

    <!-- ================== BEGIN BASE CSS STYLE ================== -->
    <link href="./Public/Admin/assets/plugins/jquery-ui/themes/base/minified/jquery-ui.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/animate.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/style.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/style-responsive.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/theme/default.css" rel="stylesheet" id="theme" />
    <!-- ================== END BASE CSS STYLE ================== -->

    <!-- ================== BEGIN PAGE LEVEL STYLE ================== -->
    <link href="./Public/Admin/assets/plugins/DataTables/css/data-table.css" rel="stylesheet" />
    <!-- ================== END PAGE LEVEL STYLE ================== -->

    <!-- ================== BEGIN BASE JS ================== -->
    <script src="./Public/Admin/assets/plugins/pace/pace.min.js"></script>
    <!-- ================== END BASE JS ================== -->
</head>
<body>
<php>include './Public/Admin/header.html'; </php>



<!-- begin #content -->
<div id="content" class="content">
    <!-- begin breadcrumb -->
    <ol class="breadcrumb pull-right">
        <li><a href="javascript:;">{$Think.lang.index}</a></li>
        <li><a href="javascript:;">{$Think.lang.oManagement}</a></li>
        <li class="active">{$Think.lang.oList}</li>

    </ol>

    <!-- end breadcrumb -->
    <!-- begin page-header -->
    <h1 class="page-header">{$Think.lang.oManagement} <small>{$Think.lang.oList}</small></h1>
    <!-- end page-header -->

    <!-- begin row -->
    <div class="row">
        <!-- begin col-12 -->
        <div class="col-md-12">
            <!-- begin panel -->
            <div class="panel panel-inverse">
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-repeat"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-danger" data-click="panel-remove"><i class="fa fa-times"></i></a>
                    </div>
                    <h4 class="panel-title">{$Think.lang.oList}</h4>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">

                        <table id="data-table" class="table table-striped table-bordered">
                            <thead>
                            <tr>
                                <th>{$Think.lang.oTime}</th>
                                <th>{$Think.lang.oNumber}</th>
                                <th>{$Think.lang.oUser}</th>
                                <th>{$Think.lang.oGoods}</th>
                                <th>{$Think.lang.oshop}</th>
                                <th>{$Think.lang.oClass}</th>
                                <th>{$Think.lang.oVideo}</th>
                                <th>{$Think.lang.oRate}</th>
                                <th>{$Think.lang.oUSD}</th>
                                <th>{$Think.lang.oRMB}</th>
                                <th>{$Think.lang.oStatusOrder}</th>
                                <th>{$Think.lang.oStatusPay}</th>
                                <th>{$Think.lang.operation}</th>
                            </tr>
                            </thead>
                            <tbody id="tbodylist">
                            <!-- <tr>
                                    <td>1</td>
                                    <td>IE</td>
                                    <td>13352646464</td>
                                    <td>hr@qw.com</td>
                                    <td>15</td>
                                    <td>
                                        <a href="#" class="btn btn-large btn-primary btn-xs">编辑</a>
                                        <a href="#" class="btn btn-large btn-primary btn-xs">删除</a>
                                    </td>
                                </tr>-->


                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <!-- end panel -->
        </div>
        <!-- end col-12 -->
    </div>
    <!-- end row -->
</div>
<!-- end #content -->


<!-- begin scroll to top btn -->
<a href="javascript:;" class="btn btn-icon btn-circle btn-success btn-scroll-to-top fade" data-click="scroll-top"><i class="fa fa-angle-up"></i></a>
<!-- end scroll to top btn -->
</div>
<!-- end page container -->

<!-- ================== BEGIN BASE JS ================== -->
<script src="./Public/Admin/assets/plugins/jquery/jquery-1.9.1.min.js"></script>
<script src="./Public/Admin/assets/plugins/jquery/jquery-migrate-1.1.0.min.js"></script>
<script src="./Public/Admin/assets/plugins/jquery-ui/ui/minified/jquery-ui.min.js"></script>
<script src="./Public/Admin/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="./Public/Admin/assets/crossbrowserjs/html5shiv.js"></script>
<script src="./Public/Admin/assets/crossbrowserjs/respond.min.js"></script>
<script src="./Public/Admin/assets/crossbrowserjs/excanvas.min.js"></script>
<![endif]-->
<script src="./Public/Admin/assets/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<!-- ================== END BASE JS ================== -->

<!-- ================== BEGIN PAGE LEVEL JS ================== -->
<script src="./Public/Admin/assets/plugins/DataTables/js/jquery.dataTables.js"></script>
<script src="./Public/Admin/assets/plugins/DataTables/js/dataTables.colVis.js"></script>
<script src="./Public/Admin/assets/js/apps.min.js"></script>
<!-- ================== END PAGE LEVEL JS ================== -->
<script>
    $(document).ready(function() {
        App.init();
        $('#data-table').DataTable({

            "columnDefs": [
                {
                    "targets": 0,
                    "data": "create_time",
                    "width":"6%",
                },
                {
                    "targets": 1,
                    "data": "order_no"},


                       
                {
                    "targets": 2,
                    "data": "uid",
                    "render": function ( data, type, row,   meta ) { // 返回自定义内容

                            return   '<td>'+row.uid+'<br/><a href="index.php?m=Admin&c=Orders&a=goods_user&order='+row.order_no+'" class="btn btn-large btn-primary btn-xs"> {$Think.lang.userDetails} </a></td>';
                    }
                },
                {
                    "targets": 3,
                    "data": "goods_ids" },
                {
                    "targets": 4,
                    "data": "shop_id" },
            
                    
                {
                    "targets": 5,
                    "data": "lid" },
                {
                    "targets": 6,
                    "data": "shipin" },
                {
                    "targets": 7,

                    "data": "rate" },
                {
                    "targets": 8,
                    "data": "goods_total_price" },
                {

                    "targets": 9,
                    "sWidth":"8%",
                    "data": "cn_goods_total_money"},
                {
                    "targets": 10,
                    "sWidth":"8%",
                    "render": function ( data, type, row ) { // 返回自定义内容
                        if(row.order_status==0){
                            return  "{$Think.lang.notConfirmed}";
                        }else if(row.order_status==1){
                            return  "{$Think.lang.confirmed}";
                        }else if(row.order_status==2){
                            return  "{$Think.lang.Cancelled}";
                        }else if(row.order_status==3){
                            return  "{$Think.lang.Closed}";
                        }
                    }
                },

                {
                    "targets": 11,
                    "sWidth":"8%",
                    "render": function ( data, type, row ) { // 返回自定义内容
                        if(row.pay_status==0){
                            return  "{$Think.lang.unpaid}";
                        }else if(row.pay_status==1){
                            return  "{$Think.lang.paid}";

                        }else if(row.pay_status==2){
                            return  "{$Think.lang.refunding}";

                        }else if(row.pay_status==3){
                            return  "{$Think.lang.refund}";
                        }
                    }
                },

                {
                    "targets": 12, // 目标列位置，下标从0开始
                    "render": function ( data, type, row,   meta ) { // 返回自定义内容
                      var html ='';
                         if(row.is_c==1){
                                 
                                 if(row.order_status==0 &&   row.pay_status==1){
                           
                                   html+= '<a href="#" onclick="caozuo(1,'+row.id+')" class="btn btn-large btn-primary btn-xs">确认</a>&nbsp;<a href="#" onclick="caozuo(2,'+row.id+')" class="btn btn-large btn-primary btn-xs">取消</a>';
                                 if(row.is_doctor==1){
                                     html+=  '<br/><a href="index.php?m=Admin&c=Orders&a=shipin&id='+row.id+'"  class="btn btn-large btn-primary btn-xs">视频时间</a>';
                                 }

                             }else{
                                html+= '<td><a href="#" class="btn btn-large btn-primary btn-xs disabled">{$Think.lang.unauthorized}</a></td>';
                             }
                             return html;

                         }else{
                             return  '<td><a href="#" class="btn btn-large btn-primary btn-xs disabled">{$Think.lang.unauthorized}</a></td>';
                         }
                   }
                }


            ],
            "oLanguage": {
                "sProcessing": "data loading.",
                "sLengthMenu": "every page show _MENU_ records",
                "sZeroRecords": "sorry， can't find",
                "sInfo": "from _START_ to _END_ / _TOTAL_ data",
                "sInfoEmpty": "no data",
                "sInfoFiltered": "(from _MAX_ search from data)",
                "sSearch": "search:  ",
                "oPaginate": {
                    "sFirst": "home page",
                    "sPrevious": "front page",
                    "sNext": "next page",
                    "sLast": "end page"
                }
            },
            "sPaginationType": "full_numbers",
            "bProcessing": true,
            "bServerSide": true,
            "bSort":false,
            "bFilter": true,
            "sAjaxSource": "index.php?m=Admin&c=Orders&a=get_order_list",

            "fnServerParams": function( aoData )
            {
                aoData.push(
                        {"name":"keywords","value":$('#keyword_txt').val()},
                        {"name":"start_date","value":$('#start_date_txt').val()},
                        {"name":"end_date","value":$('#end_date_txt').val()}
                )
            },
            "deferRender": true//处理大数据时延迟渲染数据
        });
    });




    function caozuo(obj,two){
    
        if(confirm("你确定要执行该操作？")){
            $.getJSON("index.php?m=Admin&c=Orders&a=confirm&status="+obj+'&id='+two,function(result){
                if(result==1){
                    window.location.reload();
                }
            });
        }
    }
</script>
</body>
</html>

